<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr =[
            [1],
            [1,1],
           // [1,2,1],
           // [1,3,3,1],
        ]

        for(i = 2;i <= 10; i++){
            let temp = [];
            temp[0] = 1;
            temp[i] = 1;
            for(j = 1;j<i;j++){
                temp[j] = arr[i-1][j-1] + arr[i-1][j];
            }
            arr[i] = temp;

        }



        for(let values of arr){
            let str = '';
            for(let v of values){
                str += v + ' ';
            }
            console.log(str);
        }
    </script>
</body>
</html>